<?php

class BootPage{
	
	var $control;
	var $model;
	var $view;
	var $layout;
	var $dbm;
	
	function _construct($page){
		$this->layout = new MyLayout();
		switch($page){
			case "index":
				$this->model = new Index_Model();
				$this->view  = new Index_View();
				break;
			case "congty":
				$this->control  = new Congty_Controller();
				$this->model 	= new Congty_Model();
				$this->view 	= new Congty_View();
				$this->dbm		= new Db_Manipulation();
				$this->dbm->_construct(); //kết nối CSDL
				//$this->model->_construct($this->dbm);
				break;
			default:
				echo "CHỌN SAI TRANG";
				break;
		}
	}
	
	function IndexPage(){
		
		$this->model->_construct("../library/cache.xml");
		$arrNeedUpdate = array();
		$arrNeedUpdate = $this->model->GetXmlCache();
		$this->view->_construct($arrNeedUpdate);
		
		$content = $this->view->ShowNeedUpdate();
		
		$this->layout->ShowLayout($content);
	}
	
	function congTy_Page(){				
		$this->control->_construct();
		$content = $this->control->congTy_Action($this->dbm);
		$this->layout->showLayout($content);
		
	}
	
	
	
	
}

?>